<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>Chatgpt高效使用技巧——基于Transformer模型原理 | 杨一赫的博客</title><meta name="author" content="杨一赫"><meta name="copyright" content="杨一赫"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="Chatgpt高效使用技巧——基于Transformer模型原理  ------作者：杨一赫  ChatGPT注册使用 *OpenAI-ChatGPT注册地址*：官网地址  进入ChatGPT官网，点击 Sign Up 进入下一步。 如果你已经注册了 微软&#x2F;谷歌邮箱账号 ，可以在下方快捷登录。 邮箱通过后，输入你的昵称 First Name 和 Last Name，即可下一">
<meta property="og:type" content="article">
<meta property="og:title" content="Chatgpt高效使用技巧——基于Transformer模型原理">
<meta property="og:url" content="http://yang1he.gitee.io/2023/01/06/Chatpt%E9%AB%98%E6%95%88%E4%BD%BF%E7%94%A8%E6%8A%80%E5%B7%A7%E2%80%94%E2%80%94%E5%9F%BA%E4%BA%8ETransformer%E6%A8%A1%E5%9E%8B%E5%8E%9F%E7%90%86/index.html">
<meta property="og:site_name" content="杨一赫的博客">
<meta property="og:description" content="Chatgpt高效使用技巧——基于Transformer模型原理  ------作者：杨一赫  ChatGPT注册使用 *OpenAI-ChatGPT注册地址*：官网地址  进入ChatGPT官网，点击 Sign Up 进入下一步。 如果你已经注册了 微软&#x2F;谷歌邮箱账号 ，可以在下方快捷登录。 邮箱通过后，输入你的昵称 First Name 和 Last Name，即可下一">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://img-blog.csdnimg.cn/img_convert/168ab6b97255b7565b515514b6563393.png">
<meta property="article:published_time" content="2023-01-05T16:00:00.000Z">
<meta property="article:modified_time" content="2023-03-02T13:26:38.493Z">
<meta property="article:author" content="杨一赫">
<meta property="article:tag" content="-应用文章">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://img-blog.csdnimg.cn/img_convert/168ab6b97255b7565b515514b6563393.png"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="http://yang1he.gitee.io/2023/01/06/Chatpt%E9%AB%98%E6%95%88%E4%BD%BF%E7%94%A8%E6%8A%80%E5%B7%A7%E2%80%94%E2%80%94%E5%9F%BA%E4%BA%8ETransformer%E6%A8%A1%E5%9E%8B%E5%8E%9F%E7%90%86/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//hm.baidu.com"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><meta/><meta/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.min.css" media="print" onload="this.media='all'"><script>var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?6b9e2c1c603a1d11d43a9822bdd68c2c";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"/search.xml","preload":false,"languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: undefined,
  noticeOutdate: {"limitDay":90,"position":"top","messagePrev":"距离上次更新已经","messageNext":"天本文可能会过期"},
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'Chatgpt高效使用技巧——基于Transformer模型原理',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2023-03-02 21:26:38'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><script src="https://cdn.jsdelivr.net/npm/echarts@5.3.0/dist/echarts.min.js"></script><script src="https://cdn.jsdelivr.net/npm/echarts@4.7.0/map/js/china.min.js"></script><script src="node_modules/simplex-noise/simplex-noise.js"></script><meta name="generator" content="Hexo 6.3.0"><link rel="alternate" href="/atom.xml" title="杨一赫的博客" type="application/atom+xml">
</head><body><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/pace-js/themes/blue/pace-theme-minimal.min.css"/><script src="https://cdn.jsdelivr.net/npm/pace-js/pace.min.js"></script><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/img/favicon2.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">14</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">7</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">16</div></a></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fa fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fa fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fa fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fa fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/about"><i class="fa-fw fa fa-heart"></i><span> 关于我</span></a></div><div class="menus_item"><a class="site-page" href="/messageboard/"><i class="fa-fw fa fa-paper-plane"></i><span> 留言板</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fa fa-link"></i><span> 友链</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://img-blog.csdnimg.cn/img_convert/168ab6b97255b7565b515514b6563393.png')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">杨一赫的博客</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fa fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fa fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fa fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fa fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/about"><i class="fa-fw fa fa-heart"></i><span> 关于我</span></a></div><div class="menus_item"><a class="site-page" href="/messageboard/"><i class="fa-fw fa fa-paper-plane"></i><span> 留言板</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fa fa-link"></i><span> 友链</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">Chatgpt高效使用技巧——基于Transformer模型原理</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2023-01-05T16:00:00.000Z" title="发表于 2023-01-06 00:00:00">2023-01-06</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2023-03-02T13:26:38.493Z" title="更新于 2023-03-02 21:26:38">2023-03-02</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0/">深度学习</a><i class="fas fa-angle-right post-meta-separator"></i><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0/%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0%E5%BA%94%E7%94%A8/">深度学习应用</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="Chatgpt高效使用技巧——基于Transformer模型原理"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h1
id="chatgpt高效使用技巧基于transformer模型原理">Chatgpt高效使用技巧——基于Transformer模型原理</h1>
<p align="right">
------作者：杨一赫
</p>
<h2 id="chatgpt注册使用">ChatGPT注册使用</h2>
<p><strong><em>*OpenAI-ChatGPT注册地址*</em></strong>：<a
target="_blank" rel="noopener" href="https://chat.openai.com/auth/login">官网地址</a></p>
<ol type="1">
<li>进入ChatGPT官网，点击 <strong><code>Sign Up</code></strong>
进入下一步。</li>
<li>如果你已经注册了 <strong><code>微软/谷歌邮箱账号</code></strong>
，可以在下方快捷登录。</li>
<li>邮箱通过后，输入你的昵称 <strong><code>First Name</code></strong> 和
<strong><code>Last Name</code></strong>，即可下一步。</li>
<li>验证手机号的步骤，不可以使用中国大陆手机号，可以通过先前
<strong><code>虚拟手机号接码平台</code></strong>，选取购买OpenAI专用的号码（哪个便宜买哪个），即可通过验证，其中别忘了选取正确的国家代码。</li>
<li>注册成功，在ChatGPT界面右上角点击
<strong><code>New Chat</code></strong> 和人工智能玩耍吧！</li>
</ol>
<h2 id="使用攻略">使用攻略</h2>
<p>首先贴一段chatgpt自己的回答：</p>
<p>我是一个训练有素的大型语言模型，可以帮助你回答各种问题，比如关于政治、历史、科学、技术、艺术等方面的问题。我可以帮助你理解一些概念，并为你提供有价值的信息和见解。你可以尝试提出一些问题，看看我能不能帮到你。</p>
<p>除了回答问题，我还可以帮助你写一些文章或小说。你只需要给我一些提示和背景信息，我就可以根据你提供的信息来为你写一篇文章或小说。我会尽力为你写出一篇优秀的文章，帮助你实现你的写作目标。</p>
<p>除了回答问题和写作，我还可以帮助你进行文本生成。如果你想生成一些随机的文本，你可以向我提供一些模板和关键词，我就可以根据你提供的信息生成一些随机的文本。这些文本可能是一些名言、句子、段落或者小故事，它们都可以根据你提供的信息来生成。我会尽力为你生成有趣、有用的文本，帮助你实现你的目标。</p>
<p>还有很多其他的事情，我可以帮助你完成。比如，如果你想知道某个单词的含义，你可以问我，我会告诉你这个单词的含义。如果你想了解一些事情的细节，你也可以问我，我会尽力为你提供有价值的信息。如果你有任何问题，都可以问我，我会尽力为你解答。</p>
<p>甚至这个代码库也是我写的。</p>
<ol type="1">
<li>回答问题。我能够通过文字回答问题，为用户提供信息。</li>
<li>提供建议。我能够根据用户的需求提供专业的建议。</li>
<li>计算数学问题。我能够快速准确地计算简单的数学问题。</li>
<li>翻译文本。我能够快速准确地翻译文本，让用户更好地理解内容。</li>
<li>生成文本。我能够根据提供的信息生成文本，为用户提供更多信息。</li>
<li>写作。我能够根据用户的需求进行写作，为用户提供高质量的文字内容。</li>
<li>提供知识。我能够根据用户的需求提供专业的知识，为用户提供更多信息。</li>
<li>提供解决方案。我能够根据用户提出的问题提供解决方案，帮助用户解决实际问题。</li>
<li>提供娱乐。我能够根据用户的需求提供娱乐内容，为用户提供欢乐和放松。</li>
<li>聊天。我能够通过文字和用户进行交流，提供娱乐和放松。</li>
</ol>
<p>接下来分为两部分，一是如何交互，二是如何高效交互，三是免费账户注意事项。</p>
<h3 id="如何交互">如何交互</h3>
<p>目前大多数网上的交互都是无意义的娱乐，但当把目光从文本中抽离，转化为图像，表格，公式，甚至语音，chatgpt的魔力才能真正体现。</p>
<h4 id="通过markdown-latex直接交互表格">通过markdown
latex直接交互表格</h4>
<figure>
<img
src="https://nmhjklnm.oss-cn-beijing.aliyuncs.com/article-img/img/chatGPT-screenshot.png"
alt="chatGPT-screenshot" />
<figcaption aria-hidden="true">chatGPT-screenshot</figcaption>
</figure>
<h4
id="通过slides直接生成带有插图的ppt">通过slides直接生成带有插图的ppt</h4>
<figure>
<img
src="https://nmhjklnm.oss-cn-beijing.aliyuncs.com/article-img/img/chatGPT-screenshot%20(2).png"
alt="chatGPT-screenshot (2)" />
<figcaption aria-hidden="true">chatGPT-screenshot (2)</figcaption>
</figure>
<h4 id="扮演一个数学建模专家">扮演一个数学建模专家</h4>
<figure>
<img
src="https://nmhjklnm.oss-cn-beijing.aliyuncs.com/article-img/img/chatGPT-screenshot%20(1).png"
alt="chatGPT-screenshot (1)" />
<figcaption aria-hidden="true">chatGPT-screenshot (1)</figcaption>
</figure>
<p>更多的用途有待于开拓，这三种思路也算是抛转引玉。下面是结合Chatgpt原理对chatgpt使用细节的两点优化</p>
<h3 id="结合原理的优化">结合原理的优化</h3>
<h4
id="降重----从transformer角度考量">降重----从Transformer角度考量</h4>
<p>ChatGPT的英文缩写解释为"Chat Generative Pre-trained
Transformer"。其中，GPT是“Generative Pre-trained
Transformer”的缩写，是一种自然语言处理模型，可以用来生成文本，例如回答问题或生成文章。ChatGPT则是基于GPT的模型，专门用于聊天和对话任务。</p>
<p>所以，Transformer是chatgpt基本GPT架构中的基本单元，对于Transformer性质的解构，有助于更好使用ChatGPT完成我们日常的任务</p>
<p>一个Transformer模型通常是由多个
MultiHeadedAttention单元组成，具体代码如下</p>
<figure class="highlight python"><table><tr><td class="code"><pre><span class="line"><span class="keyword">class</span> <span class="title class_">MultiHeadedAttention</span>(nn.Module):</span><br><span class="line">    <span class="keyword">def</span> <span class="title function_">__init__</span>(<span class="params">self, head, embedding_dim, dropout=<span class="number">0.1</span></span>):</span><br><span class="line">        <span class="string">&quot;&quot;&quot;在类的初始化时, 会传入三个参数，</span></span><br><span class="line"><span class="string">           head代表头数，</span></span><br><span class="line"><span class="string">           embedding_dim代表词嵌入的维度， </span></span><br><span class="line"><span class="string">           dropout代表进行dropout操作时置0比率，默认是0.1.</span></span><br><span class="line"><span class="string">        &quot;&quot;&quot;</span></span><br><span class="line">        <span class="built_in">super</span>(MultiHeadedAttention, self).__init__()</span><br><span class="line">        <span class="comment"># 在函数中，首先使用了一个测试中常用的assert语句，判断h是否能被d_model整除，</span></span><br><span class="line">        <span class="comment"># 这是因为我们之后要给每个头分配等量的词特征。也就是embedding_dim/head个.</span></span><br><span class="line">        <span class="keyword">assert</span> embedding_dim % head == <span class="number">0</span></span><br><span class="line">        self.d_k = embedding_dim // head</span><br><span class="line">        self.head = head</span><br><span class="line">        self.linears = clones(nn.Linear(embedding_dim, embedding_dim), <span class="number">4</span>)</span><br><span class="line">        self.attn = <span class="literal">None</span></span><br><span class="line">        self.dropout = nn.Dropout(p=dropout)</span><br></pre></td></tr></table></figure>
<p><code>self.dropout = nn.Dropout(p=dropout)</code>最后一行代码，dropout所起的作用是随机丢弃，在一个神经网络中，神经信号由浅向深的传播，而对这个传播过程施加随机丢弃，这也就意味着每次输出都有一定的随机性，因此，对于同一个问题，ChatGPT通常会有不同的答案。</p>
<p>在使用chatgpt的过程中，我们可以这样的特点，来实现低重复率的输出，比如</p>
<p>同一个问题问三次之后，对上面三种回复放在一起，然后</p>
<p>我：
在考虑上面三种回复的侧重点的情况下，对上面三种回答进行拼接，组成完整回答</p>
<h4 id="准确-----从encoder的角度考量">准确-----从Encoder的角度考量</h4>
<p>一个Transformer通常由Encoder以及Decoder架构组成，这也就意味着，chatgpt输出内容的准确很大程度上要看Encoder过程中喂的信息</p>
<figure>
<img
src="https://img-blog.csdnimg.cn/img_convert/168ab6b97255b7565b515514b6563393.png"
alt="image-20220924173811789" />
<figcaption aria-hidden="true">image-20220924173811789</figcaption>
</figure>
<p>通常，如果让chatgpt生成一个较长文本的回答（<span
class="math inline">\(字数\geq1000\)</span>）是比较困难的，</p>
<p>因为1000字以后会截断，截断以后再继续的回答可能会发生重复，发生概率取决于你的领域有多小众。因此，做一些改变可以提高回答的质量。</p>
<ol type="1">
<li>框架式提问，通过先生成目录的方式将本文框架盖起来</li>
<li>覆盖式提问，这里就涉及到一个官网的元素</li>
</ol>
<figure>
<img
src="https://nmhjklnm.oss-cn-beijing.aliyuncs.com/article-img/img/image-20230223185212753.png"
alt="image-20230223185212753" />
<figcaption aria-hidden="true">image-20230223185212753</figcaption>
</figure>
<p>也就是右上角的这个箭头所指的图标，点击后可以做到即使已经将问题回复完了，还可以通过修改问题的方式获得新回答</p>
<p>修改完之后点击Save就可以得到新回答，这样做的好处是回复的更加准确，同时查重率会有所降低，截止本文，chatgpt
Free还是会重复回复，因此，覆盖式提问，既能保证chatgpt记住大纲，也就是本文框架，又能维持一个长文本的准确输出。</p>
<h2 id="总结">总结</h2>
<p>以上就是对于chatgpt这几个月的使用体验，NLP领域终于有一个拿得出手的模型了，当然，也请不要太在意这点进步，毕竟还是脱离不了“有多少人工就有多少智能”的魔爪。相信有生之年能看到通用人工智能的诞生。<img
src="https://nmhjklnm.oss-cn-beijing.aliyuncs.com/article-img/img/chatGPT-screenshot%20(7).png"
alt="image-20230223185324058" /></p>
<h2 id="实操">实操</h2>
<p>基于上述规则，通过stata17.1对浙江统计年鉴数据进行建模。花了个把小时做了个试验品。大约8000字，链接放在了下面，本文除了图是直接从stata复制的，表格以及公式，以及所有文本分析摘要，大纲都原封不动取自chatgpt。效果我感觉还是比较惊艳的。</p>
<p>感觉文章完成度高，但是没有什么创新性，所以就不单独做一个博文了，点击下方链接就可以直达了</p>
<p>用了免费查重12%，查重率可以接受</p>
<p><a
href="/html/基于主成分分析对浙江省各区县综合实力进行排名.html">基于主成分分析对浙江省各区县综合实力进行排名</a></p>
<p><a
target="_blank" rel="noopener" href="https://blog.csdn.net/sadwqwe/article/details/129191035?spm=1001.2014.3001.5501">基于主成分分析对浙江省各区县综合实力进行排名_nmhjklnm的博客-CSDN博客</a></p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="http://yang1he.gitee.io">杨一赫</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="http://yang1he.gitee.io/2023/01/06/Chatpt%E9%AB%98%E6%95%88%E4%BD%BF%E7%94%A8%E6%8A%80%E5%B7%A7%E2%80%94%E2%80%94%E5%9F%BA%E4%BA%8ETransformer%E6%A8%A1%E5%9E%8B%E5%8E%9F%E7%90%86/">http://yang1he.gitee.io/2023/01/06/Chatpt%E9%AB%98%E6%95%88%E4%BD%BF%E7%94%A8%E6%8A%80%E5%B7%A7%E2%80%94%E2%80%94%E5%9F%BA%E4%BA%8ETransformer%E6%A8%A1%E5%9E%8B%E5%8E%9F%E7%90%86/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="http://yang1he.gitee.io" target="_blank">杨一赫的博客</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/%E5%BA%94%E7%94%A8%E6%96%87%E7%AB%A0/">-应用文章</a></div><div class="post_share"><div class="social-share" data-image="https://img-blog.csdnimg.cn/img_convert/168ab6b97255b7565b515514b6563393.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2023/02/23/%E5%8F%8D%E5%90%91%E4%BC%A0%E6%92%AD%E7%9A%84%E8%AE%A1%E7%AE%97%E2%80%94%E2%80%94%E6%89%8B%E6%92%95BP%E7%A5%9E%E7%BB%8F%E7%BD%91%E7%BB%9C/"><img class="prev-cover" src="https://nmhjklnm.oss-cn-beijing.aliyuncs.com/%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0%E9%A2%981.drawio.svg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">反向传播的计算——手撕BP神经网络(1)</div></div></a></div><div class="next-post pull-right"><a href="/2022/12/05/%E8%81%9A%E7%B1%BB%E5%88%86%E6%9E%90--%E5%9F%BA%E4%BA%8E%E5%85%B1%E4%BA%AB%E5%8D%95%E8%BD%A6%E6%95%B0%E6%8D%AE%E9%9B%86/"><img class="next-cover" src="https://nmhjklnm.oss-cn-beijing.aliyuncs.com/article-img/img/output_40_0.png" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">聚类分析--基于共享单车数据集</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list"><div><a href="/2023/02/28/GPTEX---%E4%B8%BAChatGPT%E8%80%8C%E7%94%9F%E7%9A%84latex%E8%BD%AF%E4%BB%B6/" title="GPTEX---为ChatGPT而生的latex软件"><img class="cover" src="https://nmhjklnm.oss-cn-beijing.aliyuncs.com/article-img/img/image-20230228145723183.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2023-02-28</div><div class="title">GPTEX---为ChatGPT而生的latex软件</div></div></a></div><div><a href="/2022/12/05/%E8%81%9A%E7%B1%BB%E5%88%86%E6%9E%90--%E5%9F%BA%E4%BA%8E%E5%85%B1%E4%BA%AB%E5%8D%95%E8%BD%A6%E6%95%B0%E6%8D%AE%E9%9B%86/" title="聚类分析--基于共享单车数据集"><img class="cover" src="https://nmhjklnm.oss-cn-beijing.aliyuncs.com/article-img/img/output_40_0.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-12-05</div><div class="title">聚类分析--基于共享单车数据集</div></div></a></div></div></div><hr/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div id="gitalk-container"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="/img/favicon2.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">杨一赫</div><div class="author-info__description">阳光开朗大男孩</div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">14</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">7</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">16</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://gitee.com/yang1he"><i class="fab fa-github"></i><span>gitee</span></a></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">平平无奇的网站</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content is-expand"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#chatgpt%E9%AB%98%E6%95%88%E4%BD%BF%E7%94%A8%E6%8A%80%E5%B7%A7%E5%9F%BA%E4%BA%8Etransformer%E6%A8%A1%E5%9E%8B%E5%8E%9F%E7%90%86"><span class="toc-number">1.</span> <span class="toc-text">Chatgpt高效使用技巧——基于Transformer模型原理</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#chatgpt%E6%B3%A8%E5%86%8C%E4%BD%BF%E7%94%A8"><span class="toc-number">1.1.</span> <span class="toc-text">ChatGPT注册使用</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BD%BF%E7%94%A8%E6%94%BB%E7%95%A5"><span class="toc-number">1.2.</span> <span class="toc-text">使用攻略</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%A6%82%E4%BD%95%E4%BA%A4%E4%BA%92"><span class="toc-number">1.2.1.</span> <span class="toc-text">如何交互</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%80%9A%E8%BF%87markdown-latex%E7%9B%B4%E6%8E%A5%E4%BA%A4%E4%BA%92%E8%A1%A8%E6%A0%BC"><span class="toc-number">1.2.1.1.</span> <span class="toc-text">通过markdown
latex直接交互表格</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%80%9A%E8%BF%87slides%E7%9B%B4%E6%8E%A5%E7%94%9F%E6%88%90%E5%B8%A6%E6%9C%89%E6%8F%92%E5%9B%BE%E7%9A%84ppt"><span class="toc-number">1.2.1.2.</span> <span class="toc-text">通过slides直接生成带有插图的ppt</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%89%AE%E6%BC%94%E4%B8%80%E4%B8%AA%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E4%B8%93%E5%AE%B6"><span class="toc-number">1.2.1.3.</span> <span class="toc-text">扮演一个数学建模专家</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%BB%93%E5%90%88%E5%8E%9F%E7%90%86%E7%9A%84%E4%BC%98%E5%8C%96"><span class="toc-number">1.2.2.</span> <span class="toc-text">结合原理的优化</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%99%8D%E9%87%8D----%E4%BB%8Etransformer%E8%A7%92%E5%BA%A6%E8%80%83%E9%87%8F"><span class="toc-number">1.2.2.1.</span> <span class="toc-text">降重----从Transformer角度考量</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%87%86%E7%A1%AE-----%E4%BB%8Eencoder%E7%9A%84%E8%A7%92%E5%BA%A6%E8%80%83%E9%87%8F"><span class="toc-number">1.2.2.2.</span> <span class="toc-text">准确-----从Encoder的角度考量</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%80%BB%E7%BB%93"><span class="toc-number">1.3.</span> <span class="toc-text">总结</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%AE%9E%E6%93%8D"><span class="toc-number">1.4.</span> <span class="toc-text">实操</span></a></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2023/06/24/An%20Intelligent%20Mobile%20Prediction%20method/" title="An Intelligent Mobile Prediction method with Mini-batch HTIA-based Seq2Seq Networks"><img src="https://nmhjklnm.oss-cn-beijing.aliyuncs.com/article-img/img/model_00.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="An Intelligent Mobile Prediction method with Mini-batch HTIA-based Seq2Seq Networks"/></a><div class="content"><a class="title" href="/2023/06/24/An%20Intelligent%20Mobile%20Prediction%20method/" title="An Intelligent Mobile Prediction method with Mini-batch HTIA-based Seq2Seq Networks">An Intelligent Mobile Prediction method with Mini-batch HTIA-based Seq2Seq Networks</a><time datetime="2023-06-23T16:00:00.000Z" title="发表于 2023-06-24 00:00:00">2023-06-24</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2023/03/05/%E5%A6%82%E4%BD%95%E8%8E%B7%E5%8F%96%E4%BD%A0%E4%B8%AA%E4%BA%BA%E8%B4%A6%E5%8F%B7%E7%9A%84openai%E7%9A%84api/" title="无题"><img src="/img/rick1.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="无题"/></a><div class="content"><a class="title" href="/2023/03/05/%E5%A6%82%E4%BD%95%E8%8E%B7%E5%8F%96%E4%BD%A0%E4%B8%AA%E4%BA%BA%E8%B4%A6%E5%8F%B7%E7%9A%84openai%E7%9A%84api/" title="无题">无题</a><time datetime="2023-03-05T05:57:17.050Z" title="发表于 2023-03-05 13:57:17">2023-03-05</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2023/03/04/%E4%B8%89%E5%88%86%E9%92%9F4%E8%A1%8C%E5%91%BD%E4%BB%A4%E6%9E%84%E5%BB%BAchatgpt%20webapp,%E6%94%AF%E6%8C%81%E9%AB%98%E5%B9%B6%E5%8F%91%E4%BB%A5%E5%8F%8A%E4%B8%8A%E4%B8%8B%E6%96%87%E5%AF%B9%E8%AF%9D%E5%8A%9F%E8%83%BD/" title="三分钟4行命令构建chatgpt webapp,支持高并发以及上下文对话功能"><img src="https://nmhjklnm.oss-cn-beijing.aliyuncs.com/article-img/img/image-20230305093941469.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="三分钟4行命令构建chatgpt webapp,支持高并发以及上下文对话功能"/></a><div class="content"><a class="title" href="/2023/03/04/%E4%B8%89%E5%88%86%E9%92%9F4%E8%A1%8C%E5%91%BD%E4%BB%A4%E6%9E%84%E5%BB%BAchatgpt%20webapp,%E6%94%AF%E6%8C%81%E9%AB%98%E5%B9%B6%E5%8F%91%E4%BB%A5%E5%8F%8A%E4%B8%8A%E4%B8%8B%E6%96%87%E5%AF%B9%E8%AF%9D%E5%8A%9F%E8%83%BD/" title="三分钟4行命令构建chatgpt webapp,支持高并发以及上下文对话功能">三分钟4行命令构建chatgpt webapp,支持高并发以及上下文对话功能</a><time datetime="2023-03-03T16:00:00.000Z" title="发表于 2023-03-04 00:00:00">2023-03-04</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2023/03/03/%E5%A4%9A%E6%A0%87%E7%AD%BE%E5%88%86%E7%B1%BB%E7%9A%84CrossEntropyLoss%E5%88%B0%E5%BA%95%E9%9C%80%E4%B8%8D%E9%9C%80%E8%A6%81One-Hot%E7%BC%96%E7%A0%81/" title="多标签分类的CrossEntropyLoss到底需不需要One-Hot编码"><img src="https://nmhjklnm.oss-cn-beijing.aliyuncs.com/article-img/img/image-20230303211538791.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="多标签分类的CrossEntropyLoss到底需不需要One-Hot编码"/></a><div class="content"><a class="title" href="/2023/03/03/%E5%A4%9A%E6%A0%87%E7%AD%BE%E5%88%86%E7%B1%BB%E7%9A%84CrossEntropyLoss%E5%88%B0%E5%BA%95%E9%9C%80%E4%B8%8D%E9%9C%80%E8%A6%81One-Hot%E7%BC%96%E7%A0%81/" title="多标签分类的CrossEntropyLoss到底需不需要One-Hot编码">多标签分类的CrossEntropyLoss到底需不需要One-Hot编码</a><time datetime="2023-03-02T16:00:00.000Z" title="发表于 2023-03-03 00:00:00">2023-03-03</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2023/02/28/GPTEX---%E4%B8%BAChatGPT%E8%80%8C%E7%94%9F%E7%9A%84latex%E8%BD%AF%E4%BB%B6/" title="GPTEX---为ChatGPT而生的latex软件"><img src="https://nmhjklnm.oss-cn-beijing.aliyuncs.com/article-img/img/image-20230228145723183.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="GPTEX---为ChatGPT而生的latex软件"/></a><div class="content"><a class="title" href="/2023/02/28/GPTEX---%E4%B8%BAChatGPT%E8%80%8C%E7%94%9F%E7%9A%84latex%E8%BD%AF%E4%BB%B6/" title="GPTEX---为ChatGPT而生的latex软件">GPTEX---为ChatGPT而生的latex软件</a><time datetime="2023-02-27T16:00:00.000Z" title="发表于 2023-02-28 00:00:00">2023-02-28</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2022 - 2023 By 杨一赫</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="chat_btn" type="button" title="聊天"><i class="fas fa-sms"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div></div></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.min.js"></script><script src="/js/search/local-search.js"></script><div class="js-pjax"><script>if (!window.MathJax) {
  window.MathJax = {
    tex: {
      inlineMath: [ ['$','$'], ["\\(","\\)"]],
      tags: 'ams'
    },
    chtml: {
      scale: 1.1
    },
    options: {
      renderActions: {
        findScript: [10, doc => {
          for (const node of document.querySelectorAll('script[type^="math/tex"]')) {
            const display = !!node.type.match(/; *mode=display/)
            const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display)
            const text = document.createTextNode('')
            node.parentNode.replaceChild(text, node)
            math.start = {node: text, delim: '', n: 0}
            math.end = {node: text, delim: '', n: 0}
            doc.math.push(math)
          }
        }, ''],
        insertScript: [200, () => {
          document.querySelectorAll('mjx-container').forEach(node => {
            if (node.hasAttribute('display')) {
              btf.wrap(node, 'div', { class: 'mathjax-overflow' })
            } else {
              btf.wrap(node, 'span', { class: 'mathjax-overflow' })
            }
          });
        }, '', false]
      }
    }
  }
  
  const script = document.createElement('script')
  script.src = 'https://cdn.jsdelivr.net/npm/mathjax/es5/tex-mml-chtml.min.js'
  script.id = 'MathJax-script'
  script.async = true
  document.head.appendChild(script)
} else {
  MathJax.startup.document.state(0)
  MathJax.texReset()
  MathJax.typeset()
}</script><script>(() => {
  const $mermaidWrap = document.querySelectorAll('#article-container .mermaid-wrap')
  if ($mermaidWrap.length) {
    window.runMermaid = () => {
      window.loadMermaid = true
      const theme = document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'default'

      Array.from($mermaidWrap).forEach((item, index) => {
        const mermaidSrc = item.firstElementChild
        const mermaidThemeConfig = '%%{init:{ \'theme\':\'' + theme + '\'}}%%\n'
        const mermaidID = 'mermaid-' + index
        const mermaidDefinition = mermaidThemeConfig + mermaidSrc.textContent
        mermaid.mermaidAPI.render(mermaidID, mermaidDefinition, (svgCode) => {
          mermaidSrc.insertAdjacentHTML('afterend', svgCode)
        })
      })
    }

    const loadMermaid = () => {
      window.loadMermaid ? runMermaid() : getScript('https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js').then(runMermaid)
    }

    window.pjax ? loadMermaid() : document.addEventListener('DOMContentLoaded', loadMermaid)
  }
})()</script><script>function addGitalkSource () {
  const ele = document.createElement('link')
  ele.rel = 'stylesheet'
  ele.href= 'https://cdn.jsdelivr.net/npm/gitalk/dist/gitalk.min.css'
  document.getElementsByTagName('head')[0].appendChild(ele)
}

function loadGitalk () {
  function initGitalk () {
    var gitalk = new Gitalk(Object.assign({
      clientID: '5a73aec03d8a0aeb971f',
      clientSecret: '54ad1c8adab95b382d582c73e9f597781de43525',
      repo: 'comment',
      owner: 'nmhjklnm',
      admin: ['nmhjklnm'],
      id: '6a83142bac831b92a51bd836148d0409',
      updateCountCallback: commentCount
    },null))

    gitalk.render('gitalk-container')
  }

  if (typeof Gitalk === 'function') initGitalk()
  else {
    addGitalkSource()
    getScript('https://cdn.jsdelivr.net/npm/gitalk/dist/gitalk.min.js').then(initGitalk)
  }
}

function commentCount(n){
  let isCommentCount = document.querySelector('#post-meta .gitalk-comment-count')
  if (isCommentCount) {
    isCommentCount.innerHTML= n
  }
}

if ('Gitalk' === 'Gitalk' || !false) {
  if (false) btf.loadComment(document.getElementById('gitalk-container'), loadGitalk)
  else loadGitalk()
} else {
  function loadOtherComment () {
    loadGitalk()
  }
}</script></div><script defer="defer" id="fluttering_ribbon" mobile="true" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/canvas-fluttering-ribbon.min.js"></script><script src="//code.tidio.co/6zvu6bgfljrvvv9rw1y7hzehoriklr03.js" async="async"></script><script>function onTidioChatApiReady() {
  window.tidioChatApi.hide();
  window.tidioChatApi.on("close", function() {
    window.tidioChatApi.hide();
  });
}
if (window.tidioChatApi) {
  window.tidioChatApi.on("ready", onTidioChatApiReady);
} else {
  document.addEventListener("tidioChat-ready", onTidioChatApiReady);
}

var chatBtnFn = () => {
  document.getElementById("chat_btn").addEventListener("click", function(){
    window.tidioChatApi.show();
    window.tidioChatApi.open();
  });
}
chatBtnFn()
</script><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/metingjs/dist/Meting.min.js"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>